package com.alibaba.serverless.domain;

import com.alibaba.serverless.common.domain.BaseEntity;
import com.aliyuncs.dm.model.v20151123.SingleSendMailRequest;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * Smtp配置
 * @author mac_zyj
 */
public class SmtpConfig extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long id;

    /** 配置名称 */
    private String configName;

    /** 账户名称 */
    private String accountName;

    /** 发送人 */
    private String fromAlias;

    /** 发送地址 */
    private String replyToAddress;

    /** 标签 */
    private String tagName;

    /** 模板名称 */
    private String templateName;

    /** 订阅 */
    private String subscribe;

    /** 0 简答发送 1 木办法 */
    private String type;

    public SingleSendMailRequest initNoReplyRequest(){
        SingleSendMailRequest request=new SingleSendMailRequest();
        request.setFromAlias(fromAlias);
        request.setTagName(tagName);
        request.setAccountName(accountName);
        request.setReplyToAddress(false);
        request.setAddressType(0);
        request.setClickTrace("0");
        return request;
    }
    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setConfigName(String configName)
    {
        this.configName = configName;
    }

    public String getConfigName()
    {
        return configName;
    }
    public void setAccountName(String accountName)
    {
        this.accountName = accountName;
    }

    public String getAccountName()
    {
        return accountName;
    }
    public void setFromAlias(String fromAlias)
    {
        this.fromAlias = fromAlias;
    }

    public String getFromAlias()
    {
        return fromAlias;
    }
    public void setReplyToAddress(String replyToAddress)
    {
        this.replyToAddress = replyToAddress;
    }

    public String getReplyToAddress()
    {
        return replyToAddress;
    }
    public void setTagName(String tagName)
    {
        this.tagName = tagName;
    }

    public String getTagName()
    {
        return tagName;
    }
    public void setTemplateName(String templateName)
    {
        this.templateName = templateName;
    }

    public String getTemplateName()
    {
        return templateName;
    }
    public void setSubscribe(String subscribe)
    {
        this.subscribe = subscribe;
    }

    public String getSubscribe()
    {
        return subscribe;
    }
    public void setType(String type)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("configName", getConfigName())
                .append("accountName", getAccountName())
                .append("fromAlias", getFromAlias())
                .append("replyToAddress", getReplyToAddress())
                .append("tagName", getTagName())
                .append("templateName", getTemplateName())
                .append("subscribe", getSubscribe())
                .append("type", getType())
                .toString();
    }
}
